package org.xx.sipahi.controllers;

import static org.xx.armory.commons.MapUtils.getInteger;
import static org.xx.armory.commons.MapUtils.getString;
import static org.xx.armory.spring5.mvc.ModelUtils.parseArgs;

public final class CategorySearchForm {
    private final String title;

    private final int module;

    public CategorySearchForm(
            String args
    ) {
        final var argMap = parseArgs(args, "title", "module");
        this.title = getString(argMap, "title");
        this.module = getInteger(argMap, "module", 1);
    }

    public String getTitle() {
        return title;
    }

    public int getModule() {
        return this.module;
    }

    @Override
    public String toString() {
        return "CategorySearchForm(" +
                ",title='" + this.title + '\'' +
                ')';
    }
}
